package com.heima.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.article.dtos.ArticleHomeDto;
import com.heima.model.article.pojos.ApArticle;
import com.heima.model.wemedia.dtos.WmFindNewsCommentsDto;
import com.heima.model.wemedia.dtos.WmUpdateCommentStatusDto;
import com.heima.model.wemedia.pojos.WmFindNewsComments;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface ApArticleMapper extends BaseMapper<ApArticle> {

    /**
     * 加载文章列表
     *
     * @param dto
     * @param type
     * @return
     */
    List<ApArticle> loadArticleList(@Param("dto") ArticleHomeDto dto, @Param("type") Short type);

    List<ApArticle> findArticleListByLast5days(@Param("dayParam") Date dayParam);

    //图文统计
    Map findNewsDimension(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate);

    //查看评论列表
    List<WmFindNewsComments> findNewsComments(@Param("dto") WmFindNewsCommentsDto dto);

    int findNewsCommentsCount(@Param("dto") WmFindNewsCommentsDto dto);


}
